package ms.jacrim.tropos;

import org.w3c.dom.Element;

public class MeansEnd extends Relationship {

	private static final String MEANSEND_TEMPLATE = "<object xmi:type=\"%s\" xmi:id=\"%s\"" + " source=\"%s\" target=\"%s\" />\r\n";

	public MeansEnd(Diagram diagram, TroposObject source, TroposObject target) {
		super(diagram, source, target);
		setType(TroposObject.MEANS_END);
	}

	public MeansEnd(Diagram diagram, Element element) {
		super(diagram, element);
	}

	void toString(StringBuilder result, int part, int indent) {
		super.toString(result, part, indent);
		if (part == 0) {
			writeIndent(result, indent);
			result.append(String.format(MEANSEND_TEMPLATE, this.getType(), this.getId(), this.getSourceId(), this.getTargetId()));
		}
	}

	@Override
	protected int NotationEdgeType() {
		return 3006;
	}
}
